#ifndef __GTK_WHITEBOARD_H_
#define __GTK_WHITEBOARD_H_

#include <gtk/gtk.h>

#include "shape.h"

typedef struct {
	GtkWidget *drawing;
	GtkWidget *event;
	GtkWidget *scrolled;
	GList *elements;
	shape_t *cur_shape;
	shape_t *sel_shape; /* TODO: replace with a list for multiple selections. */
	shape_t *sel_shape2;
	int sel_shape_line_width;
	gboolean select_tool;
	gboolean arrow_tool;
	gboolean mouse_down;
	double w, h;
	PangoLayout *pango_layout;
	double tmp_x, tmp_y;
} GtkWhiteboard;

GtkWhiteboard *
gtk_whiteboard_new();

shape_t *
gtk_whiteboard_shape_get_at(GtkWhiteboard *wb,
							double x,
							double y);

void
gtk_whiteboard_shape_delete(GtkWhiteboard *wb);

gboolean
gtk_whiteboard_key_press_event(GtkWidget *widget,
								 GdkEventKey *e,
								 gpointer data);

gboolean
gtk_whiteboard_mouse_release_event(GtkWidget *widget,
								 GdkEventButton *e,
								 gpointer data);

gboolean
gtk_whiteboard_mouse_press_event(GtkWidget *widget,
								 GdkEventButton *e,
								 gpointer data);

gboolean
gtk_whiteboard_mouse_move_event(GtkWidget *widget,
								 GdkEventMotion *e,
								 gpointer data);


void
gtk_whiteboard_shape_select(GtkWhiteboard *wb,
							char *shape_id);

void
gtk_whiteboard_connect(GtkWhiteboard *wb,
					   GCallback *click_cb,
					   gpointer click_data,
					   GCallback *move_cb,
					   gpointer move_data,
					   GCallback *key_pressed_cb,
					   gpointer key_pressed_data);

void
gtk_whiteboard_draw_elements(GtkWhiteboard *wb,
							 GList *elements);

gboolean
gtk_whiteboard_expose_event(GtkWidget *widget,
							GdkEventExpose *e,
							gpointer data);

void
gtk_whiteboard_destroy(GtkWhiteboard *wb);

#endif

